package com.liuya.safe.model;

import java.util.Comparator;
import java.util.Date;

import com.liuya.base.BaseModel;

public class SafeMenu extends BaseModel {
	
	/**
	  *属性 主键ID 
	  */
	private	String id;
	
	/**
	  *属性 创建人 
	  */
	private	String createBy;
	
	/**
	  *属性 创建时间 
	  */ 
	private	Date createTime;
	
	/**
	  *属性 修改人 
	  */
	private	String updateBy;
	
	 
	private	Date updateTime;
	
	/**
	  *属性 菜单名 
	  */
	private	String name;
	
	/**
	  *属性 路径 
	  */
	private	String url;
	
	/**
	  *属性 备注 
	  */
	private	String remark;
	
	/**
	  *属性 父菜单ID 
	  */
	private	String parentId;
	
	/**
	  *属性 序号 
	  */
	private	Integer orderNo;
	
	/**
	  *属性 模块标签 
	  */
	private	String moduleFlag;

	private	String icon;
	private	Integer status;


	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public Integer getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(Integer orderNo) {
		this.orderNo = orderNo;
	}

	public String getModuleFlag() {
		return moduleFlag;
	}

	public void setModuleFlag(String moduleFlag) {
		this.moduleFlag = moduleFlag;
	}

	@Override
	public String toString() {
		return "SafeMenu [id=" + id + ", createBy=" + createBy
				+ ", createTime=" + createTime + ", updateBy=" + updateBy
				+ ", updateTime=" + updateTime + ", name=" + name + ", url="
				+ url + ", remark=" + remark + ", parentId=" + parentId
				+ ", sortNo=" + orderNo
				+ ", moduleFlag=" + moduleFlag + "]";
	}
	
	
	public static Comparator<SafeMenu> getComparator() {
    	return new Comparator<SafeMenu>(){
			@Override
			public int compare(SafeMenu r1, SafeMenu r2) {
				if(r1.getOrderNo().intValue()>r2.getOrderNo().intValue()){
					return 1;
				}else if(r1.getOrderNo().intValue()==r2.getOrderNo().intValue()){
					return 0;
				}
				return -1;
			}
			
			
    	};
    }
	
}
